package com.boot.unity.api.modules.train.result;

import lombok.Data;

@Data
public class Result<T> {
    private String code;
    private String msg;
    private T data;

    private Result() {
    }

    private Result(String code, String msg) {
        this.code = code;
        this.msg = msg;
        this.data = null;
    }

    private Result(String code, String msg, T data) {
        this.code = code;
        this.msg = msg;
        this.data = data;
    }

    public static Result success(){
        return new Result("success","成功更新培训学时！");
    }

    public static Result success(String msg){
        return new Result("success", msg);
    }

    public static <T>Result success(String msg, T data){
        return new Result("success", msg, data);
    }



    public static Result fail(String msg){
        return new Result("fail",msg);
    }
}
